Make a full, bootable clone of your Mavericks system before you do anything. You will not be able to reinstall it easily, unless your Mac shipped with it, or you saved a Mavericks installer. You should install Yosemite on a separate partition or hard drive, rather than installing it over Mavericks. That way you still have your Mavericks system in case you hate Yosemite or find that it causes problems. When you download the Yosemite installer, you should save a copy of it. To do this, instead of letting it run when it finishes being dowbloaded, QUIT the installer app, which is located in your Applications folder. Option-drag it to a safe location outside of your Applications folder to save it. The one in the Applications folder will delete itself after it finishes installing Yosemite.
If you don't have a separate HD for a complete backup, you should get one. Drives are cheap. An app such as Carbon Copy Cloner or SuperDuper can make a bootable clone of your system HD. This is better than a Time Machine backup and should be done regardless of whether you are using Time Machine on another drive. It will allow you to use different OS versions, and to recover much more easily from problems with your main system.